﻿using Inovout.Cloud.Applications.Models;
using Inovout.Cloud.Applications.Security.Models;
using Inovout.Security;
using System.Security.Principal;

namespace Inovout.Cloud.Applications.Security
{
    public class ApplicationUserPrincipal : UserPrincipal
    {
        public Application Application { get { return this.ApplicationUser.Application; } }
        public ApplicationUser ApplicationUser { get; private set; }


        public ApplicationUserPrincipal(ApplicationUser applicationUser, IIdentity identiry)
            : this(applicationUser)
        {
            throw new System.NotImplementedException();
        }
        public ApplicationUserPrincipal(ApplicationUser applicationUser)
            : base(new ProxyUserIdentity(applicationUser, applicationUser.Application.OwnerUser, true))
        {
            this.ApplicationUser = applicationUser;
        }
    }
}
